home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Purity
/
Purity #22 (1994-01-19)(Diesel)(DE)[WB].zip
/
Purity #22 (1994-01-19)(Diesel)(DE)[WB].adf
/
MagicBlank
/
STARS.h
< prev
next >
Wrap
Text File
|
1994-01-17
|
2KB
|
83 lines
{$if not def MAGICBLANK_STARS_H}
CONST
MAGICBLANK_STARS_H = 0;
{ --------------------------------------------
-- Der Weltraum - unendliche Weiten... --
-------------------------------------------- }
{ ********************************************
* InitStars *
* *
* Funktion: Die 12 Sternpositionen und die *
* "Geschwindigkeit" der Sterne *
* festlegen. *
******************************************** }
PROCEDURE InitStars;
BEGIN
for i:=1 to 4 do
BEGIN
star[i].x:=Random(sp^.Width);
star[i].y:=Random(sp^.Height);
star[i].speedx:=-4;
END;
for i:=5 to 8 do
BEGIN
star[i].x:=Random(sp^.Width);
star[i].y:=Random(sp^.Height);
star[i].speedx:=-6;
END;
for i:=9 to 12 do
BEGIN
star[i].x:=Random(sp^.Width);
star[i].y:=Random(sp^.Height);
star[i].speedx:=-8;
END;
END;
{ ********************************************
* Stars *
* *
* Funktion: Zeichnet einen Sternenhimmel *
* in einer Seitenansicht. *
******************************************** }
PROCEDURE Stars;
VAR
dum : Integer;
x : LONG;
BEGIN
dum:=1000;
sig1 := SetSignal(0,0) AND SBF_CF{SIGBREAKF_CTRL_F};
InitStars;
While sig1 = 0 do
BEGIN
Dec(dum);
If dum<=0 then
BEGIN
DisplayBeep(sp);
SetRast(^sp^.RastPort,0);
Exit;
END;
for i:=1 to 12 do
BEGIN
SetAPen(^sp^.RastPort,0);
x:=WritePixel(^sp^.RastPort,star[i].x,star[i].y);
star[i].x:=star[i].x + star[i].speedx;
If (star[i].x<0) or (star[i].x>sp^.Width) then
BEGIN
star[i].x:=Random(sp^.Width);
star[i].y:=Random(sp^.Height);
END;
SetAPen(^sp^.RastPort,1);
x:=WritePixel(^sp^.RastPort,star[i].x,star[i].y);
sig1 := SetSignal(0,0) AND SBF_CF{SIGBREAKF_CTRL_F;}
END;
sig1 := SetSignal(0,0) AND {SIGBREAKF_CTRL_F}SBF_CF;
END;
END;
{$endif}